﻿/*
=============================================================================
Author:魏宝辉通过CodeSmithe生成
CreatedTime:2012-10-31
Description:MenuList三层结构数据访问层
=============================================================================
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using PWMIS.DataMap.Entity;
using FTchina.Models;//引入模型层
namespace FTchina.DAL
{
	public static partial class MenuListService
	{
		 
	 
			
		public static int DeleteMenuListById(int id)	
		{     
            MenuList menuList = new MenuList();
            menuList.Id = id;
            EntityQuery<MenuList> query = new EntityQuery<MenuList>(menuList);
             return query.Delete(menuList);
		}	
        
          //以标识列获得对象
        public static MenuList GetMenuListById(int  id)
        {
            MenuList menuList = new MenuList();
            menuList.Id = id;
            EntityQuery<MenuList> query = new EntityQuery<MenuList>(menuList);
            query.FillEntity(menuList);
            return menuList;
        }
		
	 
	 
       
        
        
        
		 
		 
		 public static int AddOrUpdateMenuList(MenuList menuList)
        {
            MenuList _menuList = new MenuList();

            EntityQuery<MenuList> query = new EntityQuery<MenuList>(_menuList);
           _menuList= menuList;
           int i=(menuList.Id==0)?
                 query.Insert(_menuList): query.Update(_menuList);
            return i;
        }
		
		 
	}
}

